home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / THD_12_3.ZIP / TESTINFO.H < prev    next >
Text File  |  1996-03-20  |  15KB  |  333 lines

  1. /*
  2.  
  3.             This file format may be used freely by
  4.           any utility which might have a use for it.
  5.  
  6.           If you program a file processor, you might consider
  7.           utilizing the format to simplify the programming of
  8.           external interface  utilities. (Wouldn't it be nice
  9.           if third party  utils could be used to  interface a
  10.           number of  upload testers, thus  allowing the users
  11.           of different BBS  packages an opportunity to switch
  12.           from one tester to another  without having to worry
  13.           about interfacing problems?)
  14.  
  15. ****************************************************************************
  16. **                                                                        **
  17. **    TESTINFO_REC record types as created by THD ProScan Version 10.0    **
  18. **    (or later)                                                          **
  19. **      TESTINFO.DAT is a "file of TESTINFO_REC" which is created by      **
  20. **  THD ProScan when the user has configured a BBSTYPE other than "NONE"  **
  21. **  in THDINSTL.                                                          **
  22. **                                                                        **
  23. ****************************************************************************
  24.  
  25.     Please note, I am NOT a "C" programmer by any stretch of the
  26.     imagination. The structures as follows are based on a series
  27.     of "best guesses" and does produce the correct result using
  28.     BORLAND C++ Version 3.1.
  29.     Since I'm not aware of the standards used by "C" programmers
  30.     A quick explanation is included.
  31.  
  32.     A boolean is false ONLY if the ordinal value of the char=0
  33.  
  34.     A Turbo Pascal string is an array of char where the ordinal
  35.     value of the first character is the length of the string. These
  36.     strings may or may not be null terminiated (don't count on it).
  37.  
  38.     The "WORD" type below "may" need to be defined as an unsigned int
  39.     as opposed to unsigned short int (as below) with some compilers.
  40. */
  41. typedef unsigned char boolean;      /* Turbo Pascal "boolean" */
  42. typedef unsigned char byte;         /* Turbo Pascal "byte" */
  43. typedef signed short int integer;   /* Turbo Pascal "integer" */
  44. typedef signed long int longint;    /* Turbo Pascal "longint" */
  45. typedef unsigned char string;       /* Turbo Pascal "string" */
  46. typedef unsigned short int word;    /* Turbo Pascal "word" */
  47.  
  48. typedef struct
  49.    {
  50.    boolean FILE_SFX;
  51.    boolean FILE_EXISTS;
  52.    string FILE_FULL[61];
  53.    string FILE_PATH[61];
  54.    string FILE_DRIVE[3];
  55.    string FILE_NAME[9];
  56.    string FILE_EXT[4];
  57.    string FILE_TYPE[4];
  58.    longint FILE_DT;
  59.    longint FILE_SIZE;
  60.    } TESTINFO_FILE_REC;  /*individual file information record*/
  61.  
  62.  
  63.  
  64. typedef struct
  65.    {
  66.    boolean Processed;
  67.    boolean VND_present;
  68.    boolean DESC_imp_req;
  69.    boolean ADD_rec;
  70.    boolean F_conv;
  71.    boolean Ansi_detected;
  72.    boolean Avatar_detected;
  73.    boolean CD_detected;
  74.    boolean BBS_Processed;
  75.    boolean RES_bool_one;
  76.    boolean RES_bool_two;
  77.    boolean RES_bool_thr;
  78.    boolean RES_bool_fou;
  79.    boolean RES_bool_fiv;
  80.    boolean RES_bool_six;
  81.    boolean RES_bool_sev;
  82.    boolean RES_bool_eig;
  83.    byte Check_count;
  84.    byte BBS_type;
  85.    byte COM_port;
  86.    byte EXIT_level;
  87.    byte TESTINFO_REV;
  88.    byte RES_byte_one;
  89.    byte RES_byte_two;
  90.    byte RES_byte_thr;
  91.    byte RES_byte_fou;
  92.    byte RES_byte_fiv;
  93.    byte RES_byte_six;
  94.    byte RES_byte_sev;
  95.    byte RES_byte_eig;
  96.    byte RES_byte_nin;
  97.    longint TEST_DT;
  98.    longint RES_li_one;
  99.    longint RES_li_two;
  100.    longint RES_li_thr;
  101.    longint RES_li_fou;
  102.    longint RES_li_fiv;
  103.    longint RES_li_six;
  104.    longint RES_li_sev;
  105.    longint RES_li_eig;
  106.    longint RES_li_nin;
  107.    longint RES_li_ten;
  108.    string CMD_options[61];
  109.    string BBS_data_dir[61];
  110.    string Creator[61];
  111.    string Log_path[61];
  112.    string RES_str60_one[61];
  113.    string RES_str60_two[61];
  114.    string RES_str60_thr[61];
  115.    string Ver_major[3];
  116.    string Ver_minor[3];
  117.    string VAR_ext[4];
  118.    string Desc_filename[13];
  119.    string RES_str12_one[13];
  120.    string RES_str12_two[13];
  121.    string RES_str12_thr[13];
  122.    TESTINFO_FILE_REC ORIGINAL_F_info;
  123.    TESTINFO_FILE_REC FINISHED_F_info;
  124.    integer RES_int_one;
  125.    integer RES_int_two;
  126.    integer RES_int_thr;
  127.    integer RES_int_fou;
  128.    integer RES_int_fiv;
  129.    integer Descr_Length;
  130.    char DIZ_Description[1500];
  131.    } TESTINFO_REC;  /*format of TESTINFO.DAT individual records*/
  132.  
  133. /*
  134.              *********************************
  135.              **  EACH RECORD IS 2380 BYTES  **
  136.              *********************************
  137.  
  138.     This format is Copyright 1994 - 1995 PainSoft and is freely usable but may
  139. not be modified. Persons wishing to add or change fields should contact David
  140. Muir at 1:259/423.0 (fidonet) to discuss suggestions for changes.
  141.  
  142.      This file is an "include" file for use with C++. It defines the
  143. 2 "types" used to create the file "TESTINFO.DAT" which is a data file which 
  144. can be used by external programs to update the various file databases of BBS
  145. types supported to date.
  146.      It includes a great bit of information that could be useful to utility 
  147. programmers wishing to program an interface for an upload processor and any 
  148. number of BBS programs. Much of the information included here could be easily 
  149. determined by programmers. It is included here to simply your efforts (as well 
  150. as my own).
  151.      TESTINFO.DAT has it's own numbering of BBS TYPES and reserves values of 
  152. 1-254 for standard definitions. A BBSTYPE of "0" indicates no BBS is involved
  153. and will not cause this file to be written and should therefore never be 
  154. encountered.
  155. Currently defined BBS types are as follows
  156.  
  157. 0   - No BBS (create no file)
  158. 1   - RemoteAccess 2.00 (and compatibles)
  159. 2   - Telegard 2.7
  160. 3   - Renegade 07-17 (or compatible)
  161. 4   - FILES.BBS (standard)
  162. 5   - FILES.BBS (SBBS extended format)
  163. 6   - Telegard 3.0
  164. 7   - RemoteAccess 2.5?
  165. 8   - FILES.BBS (" +" extended format)
  166. 9   - PCBoard 15.?
  167. 10  - T.A.G. (version 2.7)
  168. 11  - Wildcat v4.xx (NOT supported by THDPLUS)
  169. 12  - FILES.BBS (" |" extended format)
  170. 13 - 254 reserved for later definition.
  171. 255 - unsupported types. (all types not noted above)
  172.  
  173.      Any creator of this record should increase the "Check_Count" for each
  174. record once for each time the TESTINFO.DAT file is accessed. It is recommended
  175. to delete any record which has a Check_Count of 51 or higher or which is 
  176. marked as having been processed.
  177.  
  178. Date/Time variables as used in these records are in Packed Time Format.
  179. Turbo Pascal users can simply use "unpacktime".
  180.  
  181. The Packed Time Format (PTF) is a 32 bit Longint decoded as follows:
  182.  
  183. - for "C" programmers...
  184.   shr = shift right
  185.   and = bitwise and
  186.   $7F = 7Fh
  187. to the best of my understanding.
  188.  
  189. var
  190.   Yr    : 0..127;     Years since 1980
  191.   Month : 1..12;      Month number
  192.   Day   : 1..31;      Day of month
  193.   Hour  : 0..23;      Hour of day
  194.   Min   : 0..59;      Minute of hour
  195.   Sc    : 0..29;      Seconds divided by 2
  196.   Year  : Word;
  197.   Sec   : Word;
  198. begin
  199.   Yr    := (PTF shr 25) and $7F ;
  200.   Month := (PTF shr 21) and $0F ;
  201.   Day   := (PTF shr 16) and $1F ;
  202.   Hour  := (PTF shr 11) and $1F ;
  203.   Min   := (PTF shr  5) and $3F ;
  204.   Sc    := (PTF and $1F) ;
  205.   Year  := 1980 + Yr ;
  206.   Sec   := 2 * Sc ;
  207. end;
  208.  
  209.      It is also my understanding that "C" programmers could read this longint
  210. as two "words" (the first word being time and the second word being date).
  211.  
  212.      Outline for TESTINFO_FILE_REC as a type used below
  213.  
  214. FILE_SFX    - Is this a self extracting archive?
  215. FILE_EXISTS - did this file exist at the time this record was written
  216. FILE_FULL   - fully qualified file path - drive:\path\name.extension
  217.               "drive:" will always be included even if the user did not
  218.               supply a drive letter in the path to the test file. When this
  219.               occurs, THDPRO.EXE inserts the drive specification of the
  220.               current drive in this path. That drive specification may
  221.               differ from the time THD runs and the time an external utility
  222.               runs. Be sure to check the FILE_DRIVE variable to see that
  223.               this drive was supplied and not assumed (network drive specs
  224.               can change depending on the remote system).
  225.               [if length(FILE_DRIVE)=2 then the drive letter was supplied.]
  226. FILE_DRIVE  - Drive Letter of file path (colon is included if a drive letter
  227.               is defined. In cases where a drive letter is not specifically
  228.               supplied, this entry will be empty)
  229. FILE_PATH   - file path (in the format "\WHAT\DIR\" with both beginning and
  230.               trailing backslashes)
  231. FILE_NAME   - file name (name only no "." or extension)
  232. FILE_EXT    - file extension [note that the "." is not included in this
  233.               record]
  234. FILE_TYPE   - file "type" will be one of...
  235.               ARC / ARJ / GIF / HYP / LZH / PAK / RAR /SQZ / TD0 /UC2 / ZIP
  236.               or NON [for un-supported types] (Types reported here may be
  237.               expanded on by third party programmers, but should try to use
  238.               accepted conventions for file types, usually the file
  239.               extension would be suggested.)
  240. FILE_DT     - file date/time - (Turbo Pascal users use "unpacktime")
  241. FILE_SIZE   - file size in bytes
  242.  
  243.  
  244.      The outline for the TESTINFO.DAT record for the purpose of allowing
  245. external manipulation of file data bases or other data which may be of use to
  246. BBS manipulation.
  247.  
  248.    Labels beginning with "RES_" (as in "reserved") are currently not used (or
  249. explained here) but are present to help ensure the future compatibility of
  250. this file format.
  251.  
  252. Outline for TESTINFO_REC - (as used to create TESTINFO.DAT)
  253.  
  254. Processed        - Has this record been processed? [if true the utility which
  255.                    created this record should remove this record on it's next
  256.                    run]. Use this to indicate when the file has been
  257.                      completely processed and will no longer be required. Proper
  258.                      use of this field will help to keep the TESTINFO.DAT file
  259.                    compressed to a reasonable size.
  260. VND_present      - is VENDINFO.DIZ present in file?
  261. DESC_imp_req     - is Description importation requested? If set to false,
  262.                    the user has requested that descriptions not be imported
  263.                    into their file database.
  264. ADD_rec          - does the user wish to Create a new entry in their
  265.                    file database if one is not currently present?
  266. F_conv           - was file successfully converted [true even if file type
  267.                    was not changed during conversion]
  268. Ansi_detected    - was ANSI detected on the remote system.
  269. Avatar_detected  - was Avatar 0+ detected on remote system.
  270. CD_detected      - was carrier detected at last check on remote system?
  271. BBS_Processed    - Used by the BBS to determine if the BBS has processed
  272.                    this record.
  273. Check_count      - Number of times this record has been found but not
  274.                    processed [ Recommended to purge any record checked
  275.                    more than 50 times. as well increment this number by
  276.                    one each time a new record is added. ]
  277. BBS_type         - BBSTYPE as defined above.
  278. COM_port         - Comport used during test [0 if local].
  279. EXIT_level       - Dos Error level expected to be returned by the creator
  280.                    of the record.
  281. TESTINFO_REV     - The revision number of the TESTINFO file. Currently
  282.                    there is only revision "1" (This revision).
  283. TEST_DT          - date/time [ at time of writing this record ]
  284. CMD_options      - Command line options supplied to the creator [The first
  285.                    and last character must always be " " [space]].
  286. Log_path         - This is the full path and filename used as the creator's
  287.                    temporary log file (if any).
  288. Creator          - The name of the Program that created this record.
  289.                    Under all normal circumstances this will be
  290.                    "THD ProScan". Although if other programmers choose to
  291.                    create a record of this type, they should insert their
  292.                    own identification in this area. This is the ONLY place
  293.                    where a string variable will contain lower case.
  294. BBS_data_dir     - Path to BBS data directory [usually main BBS directory]
  295. Ver_major        - Creator's version number (major) [ie. "10"]
  296. Ver_minor        - Creator's version number (minor) [ie. "m" or ".0"]
  297. VAR_ext          - Variable extension number used for this test. (the three
  298.                    number extension used on temp directories and files
  299.                    during this test)
  300. Desc_filename    - Name of the file from which the description included
  301.                    was extracted. [blank if none] This is included if for
  302.                    some reason the third party programmer wishes to
  303.                    re-extract the file from which the description was taken.
  304.                    This file name will always be contained in the main
  305.                    archive, and thus could be extracted from the resulting
  306.                    archive if need be. This may be help for instance where a
  307.                    description is the full 1500 characters and not taken
  308.                    from a VENDINFO.DIZ. The programmer could re-extract the
  309.                    description file and use it in it's entirety (if they
  310.                    wished).
  311. ORIGINAL_F_info  - Original file information [as stored in the type
  312.                    TESTINFO_FILE_REC]. Information on the file prior to
  313.                    the creator making any modifications.
  314. FINISHED_F_info  - Finished file information [as stored in the type
  315.                    TESTINFO_FILE_REC]. Information on the resulting file after
  316.                    the creator has completed it's processing of this file.
  317.                    Changes from the original file "can" occur in any of the
  318.                    fields through archive conversion or other manipulation.
  319. Descr_Length     - Number of characters in the DIZ_Description field
  320.                    [ 0 if no description, maximum 1500 ]
  321. DIZ_Description  - Description containing the full description including
  322.                    any CR/LF (or other control or non ASCII characters) that
  323.                    may have been present in the description file used
  324.                    [maximum 1500 characters]
  325.  
  326.      ** NOTE **
  327.      All string variables and character variables will be stored as uppercase
  328. in these records except for the "CREATOR" field which contains the name of the
  329. creator of the record. There will be absolutely no lowercase information in
  330. these records anywhere else except in the diz_description field.
  331.      Strings and arrays are NOT necessarily null terminated.
  332. */
  333.